/**
 * @file ntrxiqpar.c
 * @date 2007-Dez-4
 * @author S.Radtke, O.Tekyar
 * @c (C) 2007 Nanotron Technologies
 * @brief Functions to confiure to nanoLOC transceiver modes.
 *
 * @todo making this file doxygen compatible.
 *
 * @note BuildNumber = "BuildNumber : 2267";
 *
 * @note This file contains source code for the IQ matrix values used
 * to generate the chirp seqences.
 *
 */

/*
 * $Log$
 */

#include "config.h"
#include "ntrxtypes.h"
#include "ntrxutil.h"
#include "ntrxiqpar.h"
#include "nnspi.h"
#ifdef CONFIG_NTRX_80MHZ_500NS
static const MyByte8T NA5TR1_Rx_80MHz_500ns[] PROGMEM =
{
    8,
    0x07, 0x38, 0xE0, 0xFF, 0xFF, 0xE0, 0xE3, 0x9C,
    0x0E, 0x63, 0x87, 0xF0, 0x01, 0xFC, 0x38, 0xCE,
};
#endif /* CONFIG_NTRX_80MHZ_500NS */

#ifdef CONFIG_NTRX_80MHZ_1000NS
static const MyByte8T NA5TR1_Rx_80MHz_1000ns[] PROGMEM =
{
    16,
    0x02, 0x63, 0x39, 0xC7, 0x0E, 0x0F, 0xC0, 0x1F, 0xFF, 0xE0, 0x0F, 0xC3, 0xC3, 0x8E, 0x73, 0x39,
    0x00, 0xCE, 0x63, 0x1C, 0x38, 0x3E, 0x03, 0xFF, 0xFF, 0xFF, 0x01, 0xF0, 0xF0, 0xE7, 0x19, 0x8C,
};
#endif /* CONFIG_NTRX_80MHZ_1000NS */
#ifdef CONFIG_NTRX_80MHZ_2000NS
static const MyByte8T NA5TR1_Rx_80MHz_2000ns[] PROGMEM =
{
    31,
    0x0C, 0xCC, 0xE6, 0x73, 0x1C, 0xE3, 0x8E, 0x1C, 0x3C, 0x3E, 0x0F, 0xC0, 0x7F, 0xE0, 0x00, 0x00,
    0x00, 0x00, 0x7F, 0xC0, 0x3F, 0x07, 0xC3, 0xC3, 0x87, 0x1C, 0x73, 0x9C, 0xE6, 0x63, 0x33,
    0x09, 0x99, 0x8C, 0xC6, 0x31, 0xCE, 0x3C, 0x70, 0xF0, 0xF0, 0x7E, 0x03, 0xFC, 0x00, 0x1F, 0xFF,
    0xFF, 0x80, 0x03, 0xFC, 0x07, 0xC1, 0xF0, 0xF0, 0xE3, 0x8E, 0x38, 0xC6, 0x73, 0x31, 0x99,
};
#endif /* CONFIG_NTRX_80MHZ_2000NS */
#ifdef CONFIG_NTRX_80MHZ_4000NS
static const MyByte8T NA5TR1_Rx_80MHz_4000ns[] PROGMEM =
{
    32,
    0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0xFF, 0xC0, 0x1F, 0xC0, 0x7E, 0x07, 0xC1, 0xF0, 0xF8, 0x78, 0x78,
    0xF1, 0xE3, 0x87, 0x1C, 0x63, 0x8C, 0x73, 0x9C, 0xE6, 0x33, 0x99, 0x98, 0xCC, 0xCC, 0xC0, 0x00,
    0x00, 0x01, 0xFF, 0xFF, 0xC0, 0x03, 0xFE, 0x01, 0xFC, 0x0F, 0xC1, 0xF8, 0x3C, 0x1E, 0x1E, 0x1E,
    0x3C, 0x78, 0xE3, 0x8E, 0x38, 0xC7, 0x38, 0xC6, 0x73, 0x99, 0xCC, 0xCE, 0x66, 0x66, 0x60, 0x00,
};
#endif /* CONFIG_NTRX_80MHZ_4000NS */

#ifdef CONFIG_NTRX_22MHZ_1000NS
static const MyByte8T NA5TR1_Rx_22MHz_1000ns[] PROGMEM =
{
    4,
    0xC6, 0x0F, 0xF0, 0x63,
    0x9C, 0x7F, 0xFE, 0x39,
};
#endif /* CONFIG_NTRX_22MHZ_1000NS */

#ifdef CONFIG_NTRX_22MHZ_2000NS
static const MyByte8T NA5TR1_Rx_22MHz_2000ns[] PROGMEM =
{
    8,
    0x99, 0xC7, 0x0F, 0xE0, 0x07, 0xF0, 0xE3, 0x99,
    0x33, 0x1C, 0x3E, 0x00, 0x00, 0x7C, 0x38, 0xCC,
};
#endif /* CONFIG_NTRX_22MHZ_2000NS */

#ifdef CONFIG_NTRX_22MHZ_4000NS
static const MyByte8T NA5TR1_Rx_22MHz_4000ns[] PROGMEM =
{
    16,
    0x93, 0x19, 0xCE, 0x38, 0x70, 0x7E, 0x00, 0xFF, 0xFF, 0x00, 0x7E, 0x0E, 0x1C, 0x73, 0x98, 0xC9,
    0x26, 0x33, 0x1C, 0xE1, 0xC1, 0xF0, 0x1F, 0xFF, 0xFF, 0xF8, 0x0F, 0x83, 0x87, 0x38, 0xCC, 0x64,
};
#endif /* CONFIG_NTRX_22MHZ_4000NS */

#ifdef CONFIG_NTRX_80MHZ_500NS
static const MyByte8T NA5TR1_Tx_80MHz_500ns[] PROGMEM =
{
    61,
    0xE0, 0x9C, 0x5C, 0xEF, 0xEB, 0x4A, 0x86, 0x6A, 0xBF, 0xAC, 0x8B, 0x01, 0x15, 0xF2, 0x7F, 0xF6,
    0xDF, 0xCA, 0x40, 0x84, 0x51, 0x21, 0x6F, 0x39, 0xFE, 0xFF, 0x3E, 0xBB, 0x39, 0xB7, 0xB6, 0xF6,
    0x78, 0xFA, 0xBC, 0xFF, 0xBF, 0x7C, 0xF5, 0x68, 0x59, 0x0A, 0x01, 0x83, 0xD3, 0xAB, 0xFD, 0xBB,
    0x64, 0x48, 0xC2, 0x1A, 0xFA, 0xB9, 0x96, 0x81, 0xDB, 0xF3, 0x25, 0x1A, 0x1F,
    0xF7, 0xE6, 0x89, 0x6C, 0xB6, 0xD0, 0x25, 0xDE, 0x0E, 0x36, 0x80, 0x62, 0xD9, 0x9E, 0x1F, 0x9A,
    0x04, 0x90, 0xC0, 0xF2, 0xB6, 0xFA, 0xBD, 0x2F, 0x8F, 0xEF, 0x6F, 0x0E, 0xDE, 0xAD, 0x9D, 0xAD,
    0xBE, 0xEE, 0x3F, 0xAF, 0x3F, 0xDE, 0x7B, 0xE8, 0xE4, 0x61, 0x60, 0x12, 0x27, 0x2D, 0x4F, 0xFC,
    0xF5, 0x40, 0x62, 0x0B, 0xEF, 0x2A, 0xE1, 0xE2, 0x5A, 0x9B, 0xB7, 0x27, 0xE8,
    0x79, 0x89, 0xAE, 0x66, 0x14, 0x78, 0xFB, 0xCB, 0x3A, 0x00, 0x58, 0xD2, 0xFF, 0xBF, 0x52, 0x08,
    0x08, 0x44, 0x99, 0xDA, 0xFB, 0xFB, 0xDF, 0xB7, 0x8E, 0x69, 0x4D, 0x39, 0x2C, 0x28, 0x24, 0x28,
    0x34, 0x40, 0x59, 0x79, 0xA2, 0xCA, 0xEF, 0xFF, 0xEF, 0xBF, 0x72, 0x25, 0x00, 0x24, 0x85, 0xE6,
    0xF7, 0x9B, 0x21, 0x0C, 0x80, 0xF7, 0xCB, 0x35, 0x2C, 0x99, 0xA2, 0x7A, 0x7D,
};
#endif /* CONFIG_NTRX_80MHZ_500NS */

#ifdef CONFIG_NTRX_80MHZ_1000NS
static const MyByte8T NA5TR1_Tx_80MHz_1000ns[] PROGMEM =
{
    61,
    0x20, 0xE0, 0x1D, 0xDE, 0x27, 0xA3, 0x12, 0x17, 0xF1, 0xB1, 0x10, 0x04, 0xA4, 0xFF, 0x6D, 0x09,
    0x03, 0xE2, 0xBD, 0x75, 0xD4, 0xC0, 0x0D, 0x2C, 0x7F, 0x35, 0x19, 0x03, 0xC3, 0x57, 0xB1, 0xBF,
    0x39, 0xA5, 0xCF, 0x02, 0xC2, 0x0F, 0xE2, 0x73, 0xFD, 0xFE, 0x77, 0xEA, 0x5B, 0x4F, 0x85, 0x01,
    0x80, 0x84, 0x49, 0x10, 0xD7, 0x9E, 0xE4, 0x2A, 0xEE, 0xB1, 0x33, 0x75, 0x75,
    0x08, 0xF7, 0xF7, 0x48, 0x1A, 0x56, 0xA4, 0x09, 0xCD, 0xE8, 0x81, 0xA4, 0xED, 0x4E, 0x36, 0xA0,
    0xE4, 0xFC, 0x9F, 0x89, 0x21, 0xC0, 0x97, 0xDE, 0x5F, 0x9A, 0x13, 0x20, 0xD2, 0xE9, 0xAE, 0x5F,
    0xDC, 0x16, 0x51, 0x60, 0xB1, 0xA6, 0xFA, 0x8E, 0x9F, 0x9E, 0xAC, 0x28, 0x05, 0x52, 0xE0, 0x90,
    0x40, 0xE1, 0x63, 0xB5, 0xE6, 0xF8, 0xF9, 0xDB, 0xCB, 0xAC, 0x8D, 0x7D, 0x6D,
    0x7E, 0x79, 0x85, 0x96, 0x6E, 0x51, 0x95, 0xCF, 0x7A, 0x14, 0x5C, 0xEA, 0xDB, 0x42, 0x04, 0x6C,
    0xEE, 0xE3, 0x62, 0x04, 0x30, 0xB1, 0xFF, 0xCF, 0x56, 0x04, 0x1C, 0x7D, 0xE2, 0xFF, 0xC7, 0x62,
    0x14, 0x04, 0x30, 0x81, 0xD2, 0xFB, 0xF7, 0xC7, 0x86, 0x45, 0x14, 0x00, 0x08, 0x24, 0x4C, 0x7D,
    0xA6, 0xCA, 0xE7, 0xF7, 0xFF, 0xFF, 0xFB, 0xF7, 0xEF, 0xE7, 0xE3, 0xDF, 0xDB,
};
#endif /* CONFIG_NTRX_80MHZ_1000NS */

#ifdef CONFIG_NTRX_80MHZ_2000NS
static const MyByte8T NA5TR1_Tx_80MHz_2000ns[] PROGMEM =
{
    122,
    0x1F, 0x20, 0xE0, 0x9E, 0x5F, 0xA3, 0x20, 0xDA, 0x1F, 0xE8, 0xA1, 0x14, 0x5B, 0xEE, 0x29, 0xD0,
    0x50, 0xAC, 0xB5, 0x99, 0xC4, 0x9C, 0x3B, 0x70, 0x4B, 0x84, 0xE6, 0xBF, 0xEB, 0x07, 0xC5, 0xE6,
    0x3F, 0x6F, 0x4C, 0xC1, 0x9C, 0xFB, 0x39, 0xDB, 0x41, 0x09, 0xE9, 0x7E, 0xB4, 0x15, 0x41, 0xCA,
    0x27, 0xFD, 0xB9, 0x5F, 0x06, 0x42, 0x15, 0xB1, 0x7F, 0xB6, 0x1D, 0x46, 0x81, 0xCF, 0xE8, 0xFB,
    0x3E, 0x2F, 0x58, 0x45, 0x00, 0x4B, 0xA0, 0xF4, 0xFE, 0xBC, 0x2D, 0x5A, 0xC9, 0x00, 0x03, 0xCF,
    0x60, 0xF1, 0xBC, 0x7F, 0x3A, 0xAE, 0xDF, 0xD1, 0x86, 0x00, 0x01, 0x07, 0xD1, 0xDD, 0xA9, 0xF3,
    0x7A, 0xFE, 0xBF, 0xBC, 0x37, 0x30, 0x28, 0x20, 0x58, 0x91, 0x4C, 0x47, 0x84, 0x42, 0x00, 0x00,
    0x40, 0x81, 0xC2, 0x04, 0x45, 0xC6, 0x07, 0x08, 0x49, 0x49,
    0x08, 0x08, 0xF7, 0xF7, 0x28, 0x08, 0xB7, 0xF6, 0x79, 0x19, 0x56, 0xC5, 0xD9, 0x6B, 0x17, 0x32,
    0xE7, 0x2D, 0x5A, 0x72, 0x12, 0xCB, 0xAF, 0x67, 0x90, 0xE4, 0xED, 0x2E, 0x25, 0xC0, 0x04, 0xED,
    0x4F, 0x47, 0x70, 0x92, 0xFB, 0x0F, 0xEB, 0x02, 0x60, 0x66, 0xED, 0x6F, 0x89, 0x22, 0x90, 0x65,
    0xED, 0xAF, 0xDB, 0x04, 0xD0, 0x92, 0xD9, 0xAE, 0x3F, 0x9A, 0x04, 0xD0, 0x61, 0xA6, 0xEC, 0xFF,
    0x7E, 0x49, 0x13, 0xE0, 0x41, 0x85, 0xFA, 0x8E, 0x6F, 0x1D, 0x39, 0x14, 0xA0, 0xB0, 0xD2, 0xA5,
    0xFA, 0xAD, 0xDF, 0xDF, 0xED, 0x39, 0x05, 0x42, 0xD0, 0xA0, 0x81, 0x43, 0xC5, 0xF8, 0xEB, 0x8D,
    0x0F, 0x6F, 0xCF, 0x2E, 0xAD, 0x5B, 0x19, 0x07, 0x15, 0x33, 0x72, 0xC1, 0x10, 0x60, 0xB0, 0x00,
    0x40, 0x80, 0xB0, 0xE1, 0x01, 0x21, 0x42, 0x52, 0x52, 0x62,
    0x82, 0x7E, 0x7D, 0x85, 0x86, 0x76, 0x71, 0x91, 0x9A, 0x6A, 0x59, 0x99, 0xB6, 0x6E, 0x35, 0x81,
    0xD6, 0x9B, 0x25, 0x40, 0xCE, 0xE3, 0x5A, 0x04, 0x68, 0xF2, 0xD3, 0x3E, 0x04, 0x78, 0xF7, 0xD7,
    0x46, 0x00, 0x58, 0xE2, 0xF3, 0x7B, 0x0C, 0x20, 0x9D, 0xFB, 0xD7, 0x56, 0x04, 0x2C, 0xA5, 0xFB,
    0xDF, 0x6E, 0x0C, 0x10, 0x6C, 0xDA, 0xFF, 0xC3, 0x56, 0x08, 0x10, 0x64, 0xCA, 0xFF, 0xE3, 0x8E,
    0x31, 0x00, 0x18, 0x64, 0xBE, 0xF7, 0xF7, 0xC3, 0x6E, 0x25, 0x00, 0x10, 0x48, 0x91, 0xD6, 0xFB,
    0xFB, 0xD3, 0x96, 0x55, 0x20, 0x04, 0x04, 0x20, 0x50, 0x85, 0xBA, 0xE3, 0xFB, 0xFF, 0xEF, 0xD3,
    0xAF, 0x86, 0x5D, 0x39, 0x1C, 0x0C, 0x00, 0x00, 0x08, 0x14, 0x24, 0x38, 0x4D, 0x61, 0x75, 0x8A,
    0x9A, 0xAA, 0xB6, 0xBE, 0xC7, 0xCF, 0xD3, 0xD7, 0xDB, 0xDB,
};
#endif /* CONFIG_NTRX_80MHZ_2000NS */

#ifdef CONFIG_NTRX_80MHZ_4000NS
static const MyByte8T NA5TR1_Tx_80MHz_4000ns[] PROGMEM =
{
    244,
    0xE0, 0xDF, 0x20, 0x20, 0xDF, 0xDF, 0x60, 0x21, 0x9F, 0x9D, 0xA0, 0x63, 0x1E, 0x5B, 0x21, 0xE5,
    0x9E, 0xD8, 0xA1, 0xA9, 0x1F, 0xD5, 0xDE, 0xEC, 0x63, 0x92, 0x19, 0x2D, 0xEA, 0x53, 0xD0, 0xA9,
    0x73, 0x9B, 0xC9, 0x5D, 0x77, 0x6A, 0x8B, 0x4D, 0x6E, 0x79, 0x9B, 0x03, 0xD8, 0x7A, 0x73, 0x8E,
    0xC3, 0x63, 0xFE, 0x2C, 0x07, 0x45, 0x69, 0x7F, 0x68, 0x05, 0xC7, 0x6A, 0x7F, 0xAA, 0x07, 0xC5,
    0xA6, 0x3F, 0x6F, 0x8C, 0xC1, 0x9C, 0xFB, 0x78, 0x17, 0xC0, 0xCE, 0x30, 0x3F, 0x29, 0x49, 0x02,
    0x5C, 0xFA, 0xFB, 0xDF, 0x03, 0x86, 0xA3, 0xFC, 0x39, 0x1C, 0x03, 0x86, 0x62, 0xFC, 0xFA, 0x60,
    0x05, 0x03, 0x5A, 0xB6, 0x3E, 0x6C, 0x0F, 0xC0, 0x4C, 0x27, 0xFD, 0x3A, 0x63, 0x89, 0x40, 0x4F,
    0xAB, 0xFD, 0x7A, 0xE4, 0xCB, 0xC0, 0x8B, 0x24, 0xB9, 0x7E, 0xEF, 0xD6, 0x03, 0x02, 0x92, 0x6B,
    0xFC, 0xFD, 0xAD, 0xD6, 0x04, 0x81, 0x4E, 0xE5, 0x78, 0x3F, 0x76, 0x23, 0x8E, 0x01, 0x43, 0xD1,
    0x26, 0x78, 0xBF, 0xB9, 0xE9, 0x15, 0x45, 0x80, 0x87, 0x16, 0xA9, 0x78, 0xBF, 0x7B, 0x6D, 0xDC,
    0x8C, 0x02, 0x01, 0x09, 0x18, 0x28, 0xF6, 0xFE, 0xFE, 0x36, 0x68, 0x99, 0x8B, 0x02, 0x80, 0x45,
    0x4F, 0xDC, 0x2A, 0xB6, 0xFD, 0xBF, 0x3B, 0xB3, 0xA8, 0x5B, 0xD0, 0xC7, 0x01, 0x40, 0x83, 0x8A,
    0x13, 0xDE, 0x68, 0xB2, 0x39, 0xFD, 0xFF, 0x3E, 0xF9, 0xF3, 0xEB, 0xE3, 0x9B, 0xD3, 0x4C, 0x06,
    0x42, 0x00, 0x40, 0xC1, 0x84, 0x88, 0xCD, 0x52, 0xD8, 0x1D, 0xA3, 0xE8, 0xED, 0xF1, 0xF5, 0x78,
    0x3B, 0x7C, 0xBE, 0xFF, 0xFF, 0xFF, 0xBF, 0xBE, 0x7E, 0x3D, 0xFC, 0xBB, 0xBA, 0x79, 0x38, 0xF8,
    0xF7, 0xB7, 0xB6, 0xB6,
    0xF7, 0xF7, 0x08, 0xF8, 0xF7, 0x07, 0x18, 0xF8, 0xE7, 0x07, 0x28, 0xF8, 0xC7, 0x17, 0x59, 0xE8,
    0x96, 0x16, 0x89, 0xF9, 0x66, 0xF5, 0xB9, 0x2A, 0x36, 0xA4, 0xD9, 0x8C, 0x27, 0x33, 0xB6, 0x1C,
    0x8A, 0xB3, 0x13, 0x7B, 0x6D, 0x96, 0x11, 0x27, 0x6E, 0x5B, 0x42, 0xE2, 0xCA, 0xDF, 0x98, 0x70,
    0xA3, 0xED, 0x4E, 0x36, 0xB0, 0x15, 0xEE, 0xFE, 0x15, 0xE0, 0x35, 0xDE, 0xFE, 0x25, 0xC0, 0x04,
    0xED, 0x5F, 0x47, 0x70, 0x82, 0xFB, 0xFF, 0xCA, 0x12, 0xB0, 0xA7, 0xAF, 0xCE, 0x26, 0xA0, 0xA3,
    0xFB, 0x1F, 0x0B, 0x03, 0x10, 0x24, 0xFC, 0xCF, 0xCB, 0x03, 0x30, 0x24, 0xFC, 0xEF, 0xFB, 0x04,
    0xE0, 0xC3, 0xFA, 0x5F, 0x9E, 0x27, 0x51, 0xE0, 0x86, 0xED, 0xBF, 0xFC, 0x05, 0xA0, 0x41, 0xB7,
    0xDD, 0xAF, 0xFC, 0x05, 0x80, 0x00, 0x75, 0xFC, 0x1F, 0x8E, 0x48, 0x12, 0x20, 0xA2, 0xC7, 0xDD,
    0xCF, 0x5D, 0x38, 0x22, 0x00, 0x71, 0xA6, 0xFB, 0x3F, 0xEF, 0xAB, 0x06, 0x61, 0x70, 0xC2, 0xC6,
    0xEC, 0x4F, 0x0F, 0xDC, 0x17, 0x23, 0xE0, 0x10, 0x33, 0xE8, 0xDC, 0x3F, 0x1F, 0x0D, 0x39, 0x04,
    0x71, 0x50, 0x71, 0x64, 0xE8, 0xEC, 0x5E, 0x7F, 0x7E, 0x9C, 0x18, 0x14, 0x71, 0x30, 0x20, 0x02,
    0xA5, 0xF8, 0xDC, 0x6E, 0xBF, 0xEF, 0x1E, 0x7B, 0x18, 0x05, 0x42, 0xC0, 0x70, 0x20, 0xD1, 0x63,
    0xC6, 0xF8, 0xEB, 0x9D, 0x2F, 0x9F, 0x0F, 0x6F, 0xED, 0x7B, 0x29, 0x07, 0x05, 0x33, 0x72, 0xD1,
    0x30, 0xB0, 0x20, 0x90, 0xF1, 0x42, 0x93, 0xC5, 0xE6, 0xF8, 0xF9, 0xEA, 0xCB, 0x9C, 0x7D, 0x3E,
    0x0F, 0xCF, 0x8F, 0x5F, 0x1F, 0xEF, 0xBF, 0x8F, 0x6F, 0x4F, 0x2E, 0x0E, 0xEE, 0xDE, 0xCE, 0xBD,
    0xBD, 0xAD, 0xAD, 0x9D,
    0x7D, 0x81, 0x82, 0x7D, 0x7D, 0x82, 0x82, 0x79, 0x79, 0x8A, 0x86, 0x71, 0x75, 0x92, 0x8A, 0x69,
    0x71, 0x9A, 0x96, 0x65, 0x61, 0x9D, 0xA6, 0x66, 0x4D, 0x95, 0xBE, 0x76, 0x39, 0x79, 0xCA, 0x9B,
    0x35, 0x48, 0xBE, 0xCF, 0x56, 0x1C, 0x89, 0xEB, 0xA3, 0x1D, 0x34, 0xC5, 0xEB, 0x6A, 0x04, 0x58,
    0xEA, 0xDB, 0x46, 0x04, 0x78, 0xF7, 0xCB, 0x31, 0x08, 0x84, 0xFB, 0xCB, 0x35, 0x04, 0x78, 0xF3,
    0xD7, 0x4A, 0x00, 0x58, 0xE2, 0xEF, 0x76, 0x08, 0x28, 0xB1, 0xFF, 0xB7, 0x2D, 0x04, 0x64, 0xE2,
    0xF3, 0x87, 0x11, 0x14, 0x89, 0xF3, 0xE7, 0x72, 0x08, 0x18, 0x8D, 0xF3, 0xEB, 0x7A, 0x10, 0x10,
    0x74, 0xE2, 0xF7, 0xA3, 0x2D, 0x00, 0x3C, 0xB1, 0xFB, 0xDF, 0x76, 0x14, 0x08, 0x58, 0xC6, 0xFF,
    0xD7, 0x72, 0x14, 0x04, 0x4C, 0xB6, 0xFB, 0xEB, 0x97, 0x35, 0x00, 0x20, 0x79, 0xD6, 0xFF, 0xDB,
    0x86, 0x29, 0x00, 0x1C, 0x71, 0xCA, 0xFB, 0xEF, 0xA7, 0x4D, 0x0C, 0x04, 0x34, 0x89, 0xD6, 0xFF,
    0xEB, 0xAF, 0x5A, 0x18, 0x00, 0x1C, 0x5C, 0xAA, 0xE7, 0xFF, 0xE7, 0xAB, 0x62, 0x21, 0x00, 0x08,
    0x38, 0x79, 0xBE, 0xEF, 0xFF, 0xEB, 0xBF, 0x7E, 0x41, 0x10, 0x00, 0x0C, 0x34, 0x69, 0xA6, 0xDB,
    0xF7, 0xFF, 0xEB, 0xC7, 0x92, 0x5D, 0x2D, 0x0C, 0x00, 0x08, 0x20, 0x44, 0x75, 0xA2, 0xCA, 0xEB,
    0xFB, 0xFF, 0xF3, 0xDB, 0xBB, 0x92, 0x6E, 0x49, 0x28, 0x10, 0x04, 0x00, 0x04, 0x14, 0x28, 0x40,
    0x5D, 0x79, 0x96, 0xB2, 0xCA, 0xDF, 0xEF, 0xF7, 0xFF, 0xFF, 0xFB, 0xF7, 0xEF, 0xE3, 0xD7, 0xC7,
    0xBB, 0xAA, 0x9E, 0x8E, 0x82, 0x75, 0x69, 0x5D, 0x55, 0x4D, 0x45, 0x3D, 0x38, 0x34, 0x30, 0x2C,
    0x28, 0x28, 0x28, 0x24,
};
#endif /* CONFIG_NTRX_80MHZ_4000NS */

#ifdef CONFIG_NTRX_22MHZ_1000NS
static const MyByte8T NA5TR1_Tx_22MHz_1000ns[] PROGMEM =
{
    8,
    0x22, 0x54, 0x1E, 0xB9, 0x07, 0xC8, 0xA4, 0xB3,
    0x5C, 0x40, 0xFF, 0xC7, 0xC0, 0x55, 0xFB, 0x8D,
    0x5E, 0x9C, 0xB7, 0x00, 0x8C, 0xFB, 0xF3, 0xDB,
};
#endif /* CONFIG_NTRX_22MHZ_1000NS */

#ifdef CONFIG_NTRX_22MHZ_2000NS
static const MyByte8T NA5TR1_Tx_22MHz_2000ns[] PROGMEM =
{
    16,
    0xE1, 0x98, 0x71, 0x04, 0x7F, 0xC7, 0x5E, 0x3D, 0x4E, 0x85, 0x6A, 0x3F, 0xF5, 0x21, 0x52, 0x4B,
    0xF6, 0x8B, 0xE3, 0xFA, 0xFA, 0xB0, 0xFE, 0x4A, 0x50, 0x15, 0xDE, 0x2F, 0x8A, 0x06, 0x33, 0x82,
    0x6D, 0xB2, 0x20, 0xFA, 0x09, 0xB4, 0xC7, 0x05, 0x68, 0xFB, 0xCB, 0x4E, 0x08, 0x04, 0x18, 0x24,
};
#endif /* CONFIG_NTRX_22MHZ_2000NS */

#ifdef CONFIG_NTRX_22MHZ_4000NS
static const MyByte8T NA5TR1_Tx_22MHz_4000ns[] PROGMEM =
{
    32,
    0xA0, 0x5F, 0x1E, 0xA2, 0x9E, 0x1B, 0xAD, 0x47, 0xFF, 0x43, 0xEB, 0x6E, 0x00, 0xF3, 0xAF, 0xC1,
    0x9E, 0x7F, 0x9F, 0x00, 0xD4, 0xF7, 0x3D, 0x26, 0x0C, 0x40, 0xC5, 0x92, 0xA0, 0xEB, 0x32, 0xB5,
    0xF7, 0x39, 0x75, 0xFC, 0x91, 0xBF, 0x41, 0x4B, 0xA8, 0x22, 0xDF, 0x33, 0x45, 0x8F, 0x44, 0x81,
    0xFD, 0xED, 0x02, 0xB1, 0xD9, 0x5F, 0x4D, 0x16, 0x71, 0xC0, 0x12, 0xC6, 0xF9, 0xDB, 0x9D, 0x6D,
    0x7D, 0x7E, 0x85, 0x76, 0x7C, 0xA3, 0x30, 0xF3, 0x01, 0xD5, 0x87, 0x18, 0xF6, 0x77, 0x0C, 0xCD,
    0xDB, 0x21, 0x20, 0xC1, 0xFB, 0x97, 0x1D, 0x04, 0x44, 0x9D, 0xE3, 0xFB, 0xFB, 0xEF, 0xE3, 0xDB,
};
#endif /* CONFIG_NTRX_22MHZ_4000NS */

#ifdef CONFIG_NTRX_80MHZ_500NS
static MyByte8T NA5TR1_THRES_80MHz_500ns[] PROGMEM =
{
    0x00, 0x20, 0x20, 0x20, 0x20, /* sd:0/sr:4 */
};
#endif /* CONFIG_TRX_80MHZ_500NS */

#ifdef CONFIG_NTRX_80MHZ_1000NS
static MyByte8T NA5TR1_THRES_80MHz_1000ns[] PROGMEM =
{
    0x00, 0x36, 0x36, 0x36, 0x36, /* sd:1/sr:4 */
};
#endif /* CONFIG_TRX_80MHZ_1000NS */

#ifdef CONFIG_NTRX_80MHZ_2000NS
static MyByte8T NA5TR1_THRES_80MHz_2000ns[] PROGMEM =
{
    0x00, 0x5A, 0x5A, 0x5A, 0x5A, /* sd:2/sr:4 */
};
#endif /* CONFIG_NTRX_80MHZ_2000NS */

#ifdef CONFIG_NTRX_80MHZ_4000NS
static MyByte8T NA5TR1_THRES_80MHz_4000ns[] PROGMEM =
{
    0x00, 0x8D, 0x8D, 0x8D, 0x8D, /* sd:3/sr:4 */
};
#endif /* CONFIG_NTRX_80MHZ_4000NS */

#ifdef CONFIG_NTRX_22MHZ_1000NS
static MyByte8T NA5TR1_THRES_22MHz_1000ns[] PROGMEM =
{
    0x00, 0x11, 0x11, 0x11, 0x11, /* sd:1/sr:4 */
};
#endif /* CONFIG_NTRX_22MHZ_1000NS */

#ifdef CONFIG_NTRX_22MHZ_2000NS
static MyByte8T NA5TR1_THRES_22MHz_2000ns[] PROGMEM =
{
    0x00, 0x20, 0x20, 0x20, 0x20, /* sd:2/sr:4 */
};
#endif /* CONFIG_NTRX_22MHZ_2000NS */

#ifdef CONFIG_NTRX_22MHZ_4000NS
static MyByte8T NA5TR1_THRES_22MHz_4000ns[] PROGMEM =
{
    0x00, 0x31, 0x31, 0x31, 0x31, /* sd:3/sr:4 */
};
#endif /* CONFIG_NTRX_22MHZ_4000NS */

/**
 * @brief Initializing of iq parameter for the receiver.
 * @param bandwidth this parameter determines the the mode (fdma or 80 MHz)
 * @param symbolDur this parameter determines the symbol duration between 500ns and 8us)
 *
 * This function initializes the iq parameter for the receiver depending
 * on the bandwidth and symbol duration.
 *
 */
/**************************************************************************/
void NTRXSetRxIqMatrix (MyByte8T bandwidth, MyByte8T symbolDur)
/**************************************************************************/
{
    MyByte8T tmpBuffer[64];
    MyByte8T *ptr = NULL;
    MyWord16T len;
    if (bandwidth == NA_22MHz)
    {
        switch (symbolDur)
        {
#			ifdef CONFIG_NTRX_22MHZ_1000NS
            case NA_1us:   ptr = (MyByte8T *)NA5TR1_Rx_22MHz_1000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_1000NS */
#			ifdef CONFIG_NTRX_22MHZ_2000NS
             case NA_2us:   ptr = (MyByte8T *)NA5TR1_Rx_22MHz_2000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_2000NS */
#			ifdef CONFIG_NTRX_22MHZ_4000NS
            case NA_4us:   ptr = (MyByte8T *)NA5TR1_Rx_22MHz_4000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_4000NS */
            default: return;
        }
    }
    if (bandwidth == NA_80MHz)
    {
        switch (symbolDur)
        {
#			ifdef CONFIG_NTRX_80MHZ_500NS
            case NA_500ns: ptr = (MyByte8T *)NA5TR1_Rx_80MHz_500ns; break;
#			endif /* CONFIG_NTRX_80MHZ_500NS */
#			ifdef CONFIG_NTRX_80MHZ_1000NS
            case NA_1us:   ptr = (MyByte8T *)NA5TR1_Rx_80MHz_1000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_1000NS */
#			ifdef CONFIG_NTRX_80MHZ_2000NS
            case NA_2us:   ptr = (MyByte8T *)NA5TR1_Rx_80MHz_2000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_2000NS */
#			ifdef CONFIG_NTRX_80MHZ_4000NS
            case NA_4us:   ptr = (MyByte8T *)NA5TR1_Rx_80MHz_4000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_4000NS */
            default: return;
        }
    }

    len = ReadRomByte (ptr[0]);
    /* Device select 3 */
    memcpy_P (tmpBuffer, &(ptr[1]), len);
    NTRXSetIndexReg (0x30);
    NTRXSPIWrite ((NA_RamD3lPatI_O & 0xff),     tmpBuffer, len);

    memcpy_P (tmpBuffer, &(ptr[1+ len]), len);
    NTRXSetIndexReg (0x31);
    NTRXSPIWrite ((NA_RamD3lPatQ_O & 0xff),     tmpBuffer, len);
}


/**
 * @brief Initializing of iq parameter for the transmitter.
 * @param bandwidth this parameter determines the the mode (fdma or 80 MHz)
 * @param symbolDur this parameter determines the symbol duration between 500ns and 8us)
 *
 * This function initializes the iq parameter for the transmitter depending
 * on the bandwidth and symbol duration.
 *
 */
void NTRXSetTxIqMatrix (MyByte8T bandwidth, MyByte8T symbolDur)
{
    MyByte8T tmpBuffer[245];
    MyWord16T len;
    MyWord16T offset;
    MyByte8T *ptr = NULL;

    if (bandwidth == NA_22MHz)
    {
        switch (symbolDur)
        {
#			ifdef CONFIG_NTRX_22MHZ_1000NS
            case NA_1us:   ptr = (MyByte8T *)NA5TR1_Tx_22MHz_1000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_1000NS */
#			ifdef CONFIG_NTRX_22MHZ_2000NS
            case NA_2us:   ptr = (MyByte8T *)NA5TR1_Tx_22MHz_2000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_2000NS */
#			ifdef CONFIG_NTRX_22MHZ_4000NS
            case NA_4us:   ptr = (MyByte8T *)NA5TR1_Tx_22MHz_4000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_4000NS */
            default: return;
        }
    }
    if (bandwidth == NA_80MHz)
    {
        switch (symbolDur)
        {
#			ifdef CONFIG_NTRX_80MHZ_500NS
            case NA_500ns: ptr = (MyByte8T *)NA5TR1_Tx_80MHz_500ns; break;
#			endif /* CONFIG_NTRX_80MHZ_500NS */
#			ifdef CONFIG_NTRX_80MHZ_1000NS
            case NA_1us:   ptr = (MyByte8T *)NA5TR1_Tx_80MHz_1000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_1000NS */
#			ifdef CONFIG_NTRX_80MHZ_2000NS
            case NA_2us:   ptr = (MyByte8T *)NA5TR1_Tx_80MHz_2000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_2000NS */
#			ifdef CONFIG_NTRX_80MHZ_4000NS
            case NA_4us:   ptr = (MyByte8T *)NA5TR1_Tx_80MHz_4000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_4000NS */
            default: return;
        }
    }

    len = ReadRomByte (ptr[0]);

    NTRXSetIndexReg (0x20);

	NTRXSPIWriteByte (NA_CsqMemAddrInit_O, ntrxShadowReg[NA_CsqMemAddrInit_O] | (1 << NA_CsqMemAddrInit_B));
    offset = 0;
    if (len > 128)
    {
        len -= 128;
        memcpy_P (tmpBuffer, &(ptr[1]), 128);
        NTRXSPIWrite (0x80, tmpBuffer, 128);
        offset = 128;
    }
    memcpy_P (tmpBuffer, &(ptr[1 + offset]), len);
    NTRXSPIWrite (0x80, tmpBuffer, len);

	NTRXSPIWriteByte (NA_CsqMemAddrInit_O, ntrxShadowReg[NA_CsqMemAddrInit_O] | (1 << NA_CsqMemAddrInit_B));
    NTRXSetIndexReg (0x21);
    offset = 0;
    len = ReadRomByte (ptr[0]);
    if (len > 128)
    {
        len -= 128;
        memcpy_P (tmpBuffer, &(ptr[1 + ReadRomByte (ptr[0])]), 128);
        NTRXSPIWrite (0x80, tmpBuffer, 128);
        offset = 128;
    }
    memcpy_P (tmpBuffer, &(ptr[1 + ReadRomByte (ptr[0]) + offset]), len);
    NTRXSPIWrite (0x80, tmpBuffer, len);

	NTRXSPIWriteByte (NA_CsqMemAddrInit_O, ntrxShadowReg[NA_CsqMemAddrInit_O] | (1 << NA_CsqMemAddrInit_B));
    NTRXSetIndexReg (0x22);

    len = ReadRomByte (ptr[0]);
    offset = 0;
    if (len > 128)
    {
         len -= 128;
        memcpy_P (tmpBuffer, &(ptr[1 + (2 * ReadRomByte (ptr[0]))]), 128);
        NTRXSPIWrite (0x80, tmpBuffer, 128);
        offset = 128;
    }
    memcpy_P (tmpBuffer, &(ptr[1 + (2 * ReadRomByte (ptr[0])) + offset]), len);
    NTRXSPIWrite (0x80, tmpBuffer, len);

    NTRXSetIndexReg (0x00);
}

/**
 * @brief Initializing the AGC values
 * @param bandwidth this parameter determines the the mode (fdma or 80 MHz)
 * @param symbolDur this parameter determines the symbol duration between 500ns and 8us)
 * @param symbolRate this parameter determines the symbol rate between 125kbit and 2Mbit)
 *
 * This function initializes the agc values for a specific mode.
 *
 */
void NTRXSetAgcValues (MyByte8T bandwidth, MyByte8T symbolDur, MyByte8T symbolRate)
{
    if (bandwidth == NA_80MHz)
    {
		ntrxShadowReg[NA_FdmaEnable_O] &= ~(1 << NA_FdmaEnable_B);
		NTRXSPIWriteByte (NA_FdmaEnable_O, ntrxShadowReg[NA_FdmaEnable_O]);

		ntrxShadowReg[NA_PulseDetDelay_O] &= ~(0x3f << NA_PulseDetDelay_LSB);
		ntrxShadowReg[NA_PulseDetDelay_O] |= (4 << NA_PulseDetDelay_LSB);
		NTRXSPIWriteByte (NA_PulseDetDelay_O, ntrxShadowReg[NA_PulseDetDelay_O]);
    }
	ntrxShadowReg[NA_AgcHold_O] |= (1 << NA_AgcHold_B);
	NTRXSPIWriteByte (NA_AgcHold_O, ntrxShadowReg[NA_AgcHold_O]);

	ntrxShadowReg[NA_AgcDefaultEn_O] |= (1 << NA_AgcDefaultEn_B);
	NTRXSPIWriteByte (NA_AgcDefaultEn_O, ntrxShadowReg[NA_AgcDefaultEn_O]);

	ntrxShadowReg[NA_AgcValue_O] &= ~(0x3f << NA_AgcValue_LSB);
	ntrxShadowReg[NA_AgcValue_O] |= (35 << NA_AgcValue_LSB);
	NTRXSPIWriteByte (NA_AgcValue_O, ntrxShadowReg[NA_AgcValue_O]);

	ntrxShadowReg[NA_AgcRangeOffset_O] &= ~(0x0f << NA_AgcRangeOffset_LSB);
	ntrxShadowReg[NA_AgcRangeOffset_O] |= (12 << NA_AgcRangeOffset_LSB);
	NTRXSPIWriteByte (NA_AgcRangeOffset_O, ntrxShadowReg[NA_AgcRangeOffset_O]);

    if (bandwidth == NA_22MHz)
    {
		ntrxShadowReg[NA_FdmaEnable_O] |= (1 << NA_FdmaEnable_B);
		NTRXSPIWriteByte (NA_FdmaEnable_O, ntrxShadowReg[NA_FdmaEnable_O]);

		ntrxShadowReg[NA_PulseDetDelay_O] &= ~(0x1f << NA_PulseDetDelay_LSB);
		ntrxShadowReg[NA_PulseDetDelay_O] |= (2 << NA_PulseDetDelay_LSB);
		NTRXSPIWriteByte (NA_PulseDetDelay_O, ntrxShadowReg[NA_PulseDetDelay_O]);
    }

	ntrxShadowReg[NA_LnaFreqAdjust_O] &= ~(0x03 << NA_LnaFreqAdjust_LSB);
	NTRXSPIWriteByte (NA_LnaFreqAdjust_O, ntrxShadowReg[NA_LnaFreqAdjust_O]);

	ntrxShadowReg[NA_GateSizeFramesync_O] &= ~(0x03 << NA_GateSizeFramesync_LSB);
	ntrxShadowReg[NA_GateSizeFramesync_O] |= (NA_GateSize5Slots_VC_C << NA_GateSizeFramesync_LSB);
	NTRXSPIWriteByte (NA_GateSizeFramesync_O, ntrxShadowReg[NA_GateSizeFramesync_O]);

    /*select 0: MAP (maximum a posteriori) mode (peak detection)
     *    or 1: FIX mode (threshold detection)
     */
	ntrxShadowReg[NA_D3lFixnMap_O] &= ~(1 << NA_D3lFixnMap_B);
	ntrxShadowReg[NA_D3lFixnMap_O] |= (modeSet.fixnmap << NA_D3lFixnMap_B);
	NTRXSPIWriteByte (NA_D3lFixnMap_O, ntrxShadowReg[NA_D3lFixnMap_O]);

	ntrxShadowReg[NA_SymbolDur_O] &= ~((0x07 << NA_SymbolDur_LSB) | (0x07 << NA_SymbolRate_LSB));
	ntrxShadowReg[NA_SymbolDur_O] |= ((symbolDur << NA_SymbolDur_LSB) | (symbolRate << NA_SymbolRate_LSB));
	NTRXSPIWriteByte (NA_SymbolDur_O, ntrxShadowReg[NA_SymbolDur_O]);

}

/**
 * @brief Initializing of correlator threshold values for a specific mode.
 * @param bandwidth this parameter determines the the mode (fdma or 80 MHz)
 * @param symbolDur this parameter determines the symbol duration between 500ns and 8us)
 *
 * This function initializes the correlator threshold registers for a
 * specific mode.
 *
 */
/**************************************************************************/
void NTRXSetCorrThreshold (MyByte8T bandwidth, MyByte8T symbolDur)
/**************************************************************************/
{
    MyByte8T threshold[5];
    MyByte8T *ptr = NULL;

    NTRXSetIndexReg (0x32);
    if (bandwidth == NA_80MHz)
    {
        switch (symbolDur)
        {
#			ifdef CONFIG_NTRX_80MHZ_500NS
            case NA_500ns:  ptr = (MyByte8T *)NA5TR1_THRES_80MHz_500ns; break;
#			endif /* CONFIG_NTRX_80MHZ_500NS */
#			ifdef CONFIG_NTRX_80MHZ_1000NS
            case NA_1us:    ptr = (MyByte8T *)NA5TR1_THRES_80MHz_1000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_1000NS */
#			ifdef CONFIG_NTRX_80MHZ_2000NS
            case NA_2us:    ptr = (MyByte8T *)NA5TR1_THRES_80MHz_2000ns; break;
#			endif /* CONFIG_NTRX_80MHZ_2000NS */
#			ifdef CONFIG_NTRX_80MHZ_4000NS
            case NA_4us:    ptr = (MyByte8T *)NA5TR1_THRES_80MHz_4000ns; break;
#			endif /* NTRX_80MHZ_4000NS */
            default:        return;
        }
    }

    if (bandwidth == NA_22MHz)
    {
        switch (symbolDur)
        {
#			ifdef CONFIG_NTRX_22MHZ_1000NS
            case NA_1us:    ptr = (MyByte8T *)NA5TR1_THRES_22MHz_1000ns; break;
#			endif /* NTRX_22MHZ_1000NS */
#			ifdef CONFIG_NTRX_22MHZ_2000NS
            case NA_2us:    ptr = (MyByte8T *)NA5TR1_THRES_22MHz_2000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_2000NS */
#			ifdef CONFIG_NTRX_22MHZ_4000NS
            case NA_4us:    ptr = (MyByte8T *)NA5TR1_THRES_22MHz_4000ns; break;
#			endif /* CONFIG_NTRX_22MHZ_4000NS */
            default:        return;
        }
    }

    memcpy_P (threshold, ptr, 5);
    NTRXSPIWrite (0x80, threshold, 5);
}
